<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>设值</h1>
    <script>
      const et1 = new Date("2023-9-10").toUTCString();
      const et2 = new Date(+new Date() + 5000).toUTCString();
      document.cookie = `name=jack;expires=${et1}`;
      document.cookie = `age=20;expires=${et2}`;
      document.cookie = `gender=boy;max-age=10`;

      // name=jack; age=20
      console.log(document.cookie);
    </script>
  </body>
</html>
